﻿<UserControl
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:tb="http://www.hardcodet.net/taskbar"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
  x:Class="CG.SpotifyControl.NotifyBalloon"
  x:Name="NotifyBalloonPopup"
  Height="126"
  Width="308">
	<UserControl.Resources>
		<Storyboard x:Key="FadeIn">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Popup" Storyboard.TargetProperty="(UIElement.Opacity)">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
				<SplineDoubleKeyFrame KeyTime="00:00:01" Value="0.95"/>
				<SplineDoubleKeyFrame KeyTime="00:00:03" Value="0.95"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="FadeBack">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Popup" Storyboard.TargetProperty="(UIElement.Opacity)">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
				<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="FadeOut" Completed="OnFadeOutCompleted" >
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Popup" Storyboard.TargetProperty="(UIElement.Opacity)">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
				<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0.2"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="HighlightCloseButton">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="imgClose" Storyboard.TargetProperty="(UIElement.Opacity)">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.4"/>
				<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="FadeCloseButton">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="imgClose" Storyboard.TargetProperty="(UIElement.Opacity)">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
				<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0.4"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
	</UserControl.Resources>
	<UserControl.Triggers>
		<EventTrigger RoutedEvent="tb:TaskbarIcon.BalloonShowing">
			<BeginStoryboard x:Name="FadeIn_BeginStoryboard" Storyboard="{StaticResource FadeIn}" />
		</EventTrigger>
		<EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="imgClose">
			<BeginStoryboard x:Name="HighlightCloseButton_BeginStoryboard" Storyboard="{StaticResource HighlightCloseButton}" />
		</EventTrigger>
		<EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="imgClose">
			<BeginStoryboard x:Name="FadeCloseButton_BeginStoryboard" Storyboard="{StaticResource FadeCloseButton}" />
		</EventTrigger>
		<EventTrigger RoutedEvent="Mouse.MouseEnter">
			<StopStoryboard BeginStoryboardName="FadeIn_BeginStoryboard" />
			<BeginStoryboard x:Name="FadeBack_BeginStoryboard" Storyboard="{StaticResource FadeBack}" />
		</EventTrigger>
		<EventTrigger RoutedEvent="tb:TaskbarIcon.BalloonClosing">
			<BeginStoryboard x:Name="FadeOut_BeginStoryboard" Storyboard="{StaticResource FadeOut}" />
		</EventTrigger>
	</UserControl.Triggers>
	<Grid x:Name="Popup" MouseEnter="grid_MouseEnter" MouseLeave="grid_MouseLeave">
		<Border x:Name="PopupBorder"
			HorizontalAlignment="Stretch"
			Margin="5"
			BorderThickness="1,1,1,1"
			BorderBrush="{DynamicResource ButtonStroke}" Background="{DynamicResource GlyphBackground}">
			<Border.Effect>
				<DropShadowEffect Color="#FF747474"/>
			</Border.Effect>
		</Border>
		<Label Content="SpotifyControl: Infos" Margin="5,5,5,0" Padding="5,0,5,1" FontStyle="Italic" Height="20" VerticalAlignment="Top" BorderThickness="0" VerticalContentAlignment="Center" Foreground="#FF1A1A1A">
			<Label.Background>
				<LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
					<LinearGradientBrush.RelativeTransform>
						<TransformGroup>
							<ScaleTransform CenterY="0.5" CenterX="0.5"/>
							<SkewTransform CenterY="0.5" CenterX="0.5"/>
							<RotateTransform CenterY="0.5" CenterX="0.5"/>
							<TranslateTransform/>
						</TransformGroup>
					</LinearGradientBrush.RelativeTransform>
					<GradientStop Color="#CC3F3F3F" Offset="0.401"/>
					<GradientStop Offset="1"/>
				</LinearGradientBrush>
			</Label.Background>
		</Label>
		<Image HorizontalAlignment="Right" Margin="0,7,8,0" VerticalAlignment="Top" Width="16" Height="16" Source="/SpotifyControl;component/Graphics/ClosePreviewHH.png"  Stretch="Fill" Opacity="0.8" ToolTip="Close" x:Name="imgClose" MouseDown="imgClose_MouseDown"/>
		<Border x:Name="ImageBorder" BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Right" Margin="0,30.2,10,0" Width="85" Height="85" VerticalAlignment="Top">
			<Image Source="{Binding TrackInfos.AlbumArt, Converter={StaticResource BitmapToBitmapSource}, Mode=OneWay}" Stretch="Uniform"/>
		</Border>
		
		<Path
			Fill="#FFFFFFFF"
			Stretch="Fill"
			Margin="5,86,95,0"
			VerticalAlignment="Top"
			Height="2"
			Data="M26,107 L220.04123,107" SnapsToDevicePixels="True" StrokeThickness="2">
			<Path.Stroke>
				<LinearGradientBrush EndPoint="0.973,0.5" StartPoint="0.005,0.5">
					<GradientStop Color="#00ADADAD" Offset="1" />
					<GradientStop Color="#87393939" />
				</LinearGradientBrush>
			</Path.Stroke>
		</Path>
		<TextBlock Margin="5,31,95,0" Text="{Binding TrackInfos.TrackName, FallbackValue=Title, Mode=OneWay}" TextWrapping="Wrap" Foreground="#FF9D9D9D" FontWeight="Bold" FontSize="10.667" Height="17" VerticalAlignment="Top" Padding="5,0"/>
		<TextBlock Margin="5,48,95,60.333" Text="{Binding TrackInfos.AlbumName, FallbackValue=Album, Mode=OneWay}" TextWrapping="Wrap" Foreground="#FF9D9D9D" FontSize="10.667" Padding="5,0"/>
		<TextBlock Margin="5,65,128,0" Text="{Binding TrackInfos.ArtistName, FallbackValue=Artist, Mode=OneWay}" TextWrapping="Wrap" Foreground="#FF9D9D9D" FontSize="10.667" Padding="5,0,0,0" VerticalAlignment="Top"/>
		<TextBlock Margin="0,65,95,0" Text="{Binding TrackInfos.AlbumYear, FallbackValue=Year, Mode=OneWay}" TextWrapping="Wrap" Foreground="#FF9D9D9D" FontSize="10.667" HorizontalAlignment="Right" Width="33" TextAlignment="Right" Padding="0,0,5,0" VerticalAlignment="Top"/>
		<TextBlock Margin="5,92,128,0" Text="{Binding TrackInfos.TrackLength, FallbackValue=01:23:45, Mode=OneWay}" TextWrapping="Wrap" Foreground="#FF9D9D9D" FontSize="10.667" Padding="5,0,0,0" Height="17" VerticalAlignment="Top" FontWeight="Bold"/>
	</Grid>
</UserControl>